<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>意见反馈</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
      <link rel="stylesheet" type="text/css" href="../css/style.css"/>
      <style>
          .feedback{width: 100%}
          .content{padding-top: 35px}
          .datails{padding: 0 15px;}
          .datails .title{font-size: 16px;color: #000;padding-bottom: 20px;padding-top: 25px}
          .datails textarea{background-color: #F7F8FA;border-radius: 10px;padding:20px 18px;box-sizing: padding-box;width: 90%;height: 110px}
          .forword{padding-top: 40px;display: flex;}
          .forword button{width: 90%;height: 50px;margin: 0 auto;border-radius: 30px;background-color: #FBBB3F;color: #fff;font-size: 16px}
      </style>
  </head>
  <body>
    <div class="feedback">
      <div class="returnBox">
        <div class="return"> <img src="../image/return.png" onclick="api.closeWin()"> <span class="us">意见反馈</span></div>
      </div>
      <div class="content">
        <div class="datails">
          <p class="title">反馈内容</p>
          <textarea  placeholder="请输入您对我们产品的宝贵意见" class="opinion"></textarea>
        </div>
        <div class="datails">
          <p class="title">联系方式</p>
          <textarea  placeholder="请留下您的邮箱，方便我们与您取得联系" class="email"></textarea>
        </div>
        <div class="forword">
          <button type="button" name="button" class="comit">发送</button>
        </div>
      </div>
    </div>
  </body>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/encrypt.js"></script>
  <script type="text/javascript">
      apiready = function(){
        $api.fixStatusBar($api.dom('.feedback'));

        var base = new Base64();
        var userid = $api.getStorage('userID');
        let json;
        if(userid){
          json = {userID:userid}
        }else{
          json = {userID:'00000000-0000-0000-0000-000000000000'}
        }


        $api.addEvt($api.dom('.comit'), 'click', function(){
          let contactInfo = $api.val($api.dom('.email'));
          let feedbackContent = $api.val($api.dom('.opinion'));

          let jsons = {contactInfo:contactInfo,feedbackContent:feedbackContent}
          let jsonss = Object.assign(json,jsons)
          
          let parameter = base.encode(JSON.stringify(jsonss));
          let signValue = parameter + secretKey
          let sign = signValue.MD5(32)
          $api.post(url+'submitSysFeedback.ashx', {values:{parameter:parameter,sign:sign}}, function(ret){
            api.toast({
              msg: ret.msg,
              duration: 2000,
              location: 'middle'
            });
          })

        });


      };
  </script>
  </html>
